package net.csdn.business.mirror.utils;

import org.apache.commons.text.StringSubstitutor;

import java.util.Map;

public class StringUtil {
    public static String replace(String templateString, Map<String, Object> parameter) {
        return replace(templateString, parameter, "{", "}");
    }

    public static String replace(String templateString, Map<String, Object> parameter, String prefix, String suffix) {
        StringSubstitutor sub = new StringSubstitutor(parameter, prefix, suffix);
        return sub.replace(templateString);
    }
}
